<template>
	<view class="container">
		<view class="header">
			<u-icon name="arrow-leftward" size="20" @click="goBack"></u-icon>
			<text class="title"> 管理选项 </text>
			<!-- <u-icon name="checkmark" size="20"></u-icon> -->
		</view>
		<u-list>
			<u-list-item v-for="item in options" :key="item.id" style="height: 60px;">
				<u-cell :title="item.name" @click="clickItem(item)"></u-cell>
			</u-list-item>
		</u-list>
	</view>
</template>

<script>
import clothes from '@/api/clothes.js'
import config from '@/config.js'; 
export default {
  data() {
    return {
		options: [
			{
				id: "categories",
				name: "分类",
				child: {
					id: "subcategories",
					name: "子类别",
				}
			},
			{
				id: "colors",
				name: "颜色",
			},
			{
				id: "season",
				name: "季节",
			},
			{
				id: "thickness",
				name: "厚度",
			},
			{
				id: "brands",
				name: "品牌",
			},
			{
				id: "sizetype",
				name: "尺码",
				child: {
					id: "sizes",
					name: "尺码",
				}
			},
			{
				id: "materials",
				name: "材质",
			},
			{
				id: "storage-locations",
				name: "位置",
			},
			{
				id: "tag-types",
				name: "标签",
				child: {
					id: "tags",
					name: "标签",
				}
			},
		]
    }
  },
  onLoad: function () { },
  methods: {
		goBack() {
		  // 返回逻辑
		  uni.navigateBack({
			  delta: 1
		  });
		},
		clickItem(item) {
			// console.log(item);
			let params = encodeURIComponent(JSON.stringify(item))
			uni.navigateTo({
				url:`./optionList?params=${params}`
			});
		},
	}
}
</script>

<style scoped>
.container {
  padding: 0px 0px;
}

.header {
	display: flex;
	/* justify-content: center; */
	align-items: center;
	padding: 10px;
	background-color: #f8f8f8;
}

.title {
	font-size: 18px;
	font-weight: bold;
	margin-left: 10px;
}
</style>
